﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Tradex;
using Tradex.Trading;

namespace Tradex.Messages {
    
    /// <summary>
    /// The PositionUpdateMessage informs of an update to a position in a specific instrument.
    /// </summary>
    [Serializable ()]
    public sealed class PositionUpdateMessage : Message {

        /// <summary>
        /// Constructor taking all parameters.
        /// </summary>
        /// <param name="positionKey"></param>
        /// <param name="positionInfo"></param>
        public PositionUpdateMessage(PositionKey positionKey, PositionUpdate positionInfo) {
            PositionKey = positionKey;
            Update = positionInfo;
        }
        
        /// <inheritdoc />
        public override MessageCode Code { get { return MessageCode.PositionUpdate; } }

        /// <summary>
        /// Gets the PositionKey for the update.
        /// </summary>
        public PositionKey PositionKey { get; private set; }

        /// <summary>
        /// Gets the Update for the update.
        /// </summary>
        public PositionUpdate Update { get; private set; }

    }

}
